//
//  UIViewController+HideNavBar.m
//  NavgationController
//
//  Created by sr Liu on 2020/7/15.
//  Copyright © 2020 sr Liu. All rights reserved.
//

#import "UIViewController+HideNavBar.h"
#import <objc/runtime.h>
@implementation UIViewController (HideNavBar)

- (BOOL)hiddenNavBarWhenPushed
{
    BOOL isHidden = NO;
    NSNumber *number = objc_getAssociatedObject(self, @selector(hiddenNavBarWhenPushed));
    if (number) {
        isHidden = [number boolValue];
    }
    return isHidden;
}

- (void)setHiddenNavBarWhenPushed:(BOOL)hiddenNavBarWhenPushed
{
    objc_setAssociatedObject(self, @selector(hiddenNavBarWhenPushed), [NSNumber numberWithBool:hiddenNavBarWhenPushed], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
@end
